<template>
  <a-form-model-item :label="attrObj.formLabel" :prop="attrObj.formProps">
    <a-date-picker
      :placeholder="changePlaceholder()"
      class="date-type"
      v-model.trim="formModel[attrObj.formProps]"
      valueFormat="YYYY-MM-DD"
      :disabled="attrObj.isDisabled"
    />
    <!-- 用valueFormat比用Format更方便 -->
  </a-form-model-item>
</template>
<script>
export default {
  name: "FormDatepicker",
  data() {
    return {};
  },
  props: {
    attrObj: {
      type: Object,
      default() {
        return {
          formLabel: "",
          formProps: "",
          isDisabled: false
        };
      }
    },
    formModel: {
      type: Object,
      default() {
        return {}
      }
    }
  },
  components: {},
  computed: {},
  mounted() {
  },
  methods: {
    changePlaceholder() {
      if (this.attrObj.fixedDisabled) return ''
      if(this.attrObj.isDisabled) return ''
      return '请选择日期'
    }
  }
};
</script>
<style lang="less" scoped>
.date-type {
  width: 70%;
}
</style>
